import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../../../lib_basemodel/chat_room/flyScreen/flying_data.dart';
import '../../theme/jr.dart';

abstract class GiftFloatingContentBuilder {
  Widget build(BuildContext context, FlyingData data);

  bool match(FlyingData data);

  Widget buildUserInfo(FlyingData data) {
    return /*data.trigger.secretUser == */ true
        ? ConstrainedBox(
            constraints: BoxConstraints(maxWidth: 100),
            child: Text(
              data.senderName ?? '',
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  fontSize: 12,
                  color: JR.color.mainBrand,
                  fontWeight: FontWeight.w600),
            ),
          )
        : Row(
            mainAxisSize: MainAxisSize.min,
            children: [
              ConstrainedBox(
                constraints: BoxConstraints(maxWidth: 100),
                child: Text(
                  'data.trigger.nickname',
                  maxLines: 1,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(
                      fontSize: 12,
                      color: JR.color.mainBrand,
                      fontWeight: FontWeight.w600),
                ),
              ),
              const SizedBox(
                width: 4,
              ),
              Container(
                color: Colors.red,
                width: 40,
                height: 40,
              ),
              // SexAgeLabel(
              //     isMale: data.trigger.gender == 'male',
              //     age: data.trigger.age.toString()),
              // UserLevWidget(vipImgStr: data.trigger.vipLevelIcon),
              // UserCarLevelWidget(
              //     carLevel: data.trigger.car.carMetaInfo.level,
              //     job: data.trigger.job),
              // UserKnightWidget(imgStr: data.trigger.knightIcon)
            ],
          );
  }
}
